package com.demo;

/**
 * @Description: 圆形
 * @Author: JKchen
 * @Date: 2022/10/30 16:12
 */
public class circle extends Shape{
    private double r;
    public circle(double r){
        super("圆形");
        this.r=r;
    }
    //面积
    @Override
    public double getArea() {
        return 3.14*r*r;
    }
    //周长
    @Override
    public double getPerimeter() {
        return 2*3.14*r;
    }
}
